package com.shiro.factory;

import com.entity.SysMenu;
import com.service.SysMenuService;
import com.service.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.LinkedHashMap;
import java.util.List;

/**
 * @author lanouhn
 */
public class FilterChainDefinitionMapBuilder {
    @Autowired
    private SysUserService sysUserService;
    @Autowired
    private SysMenuService sysMenuService;

    public LinkedHashMap<String, String> buildFilterChainDefinitionMap() {
        LinkedHashMap<String, String> linkedHashMap = new LinkedHashMap<>();
//        List<SysMenu> sysMenuList = sysMenuService.selectSysMenu();
        linkedHashMap.put("/assets/**", "anon");
        linkedHashMap.put("/admin/login.jsp", "anon");
        linkedHashMap.put("/admin/login", "anon");
        linkedHashMap.put("/admin/getGifCode", "anon");
        linkedHashMap.put("/admin/system-menu-list.jsp", "roles[system-menu-list.jsp]");
        linkedHashMap.put("/admin/system-role-list.jsp", "roles[system-role-list.jsp]");
        linkedHashMap.put("/admin/system-admin-list.jsp", "roles[system-admin-list.jsp]");
        linkedHashMap.put("/admin/scrap-list.jsp", "roles[scrap-list.jsp]");
        linkedHashMap.put("/admin/scrap-collector-list.jsp", "roles[scrap-collector-list.jsp]");
        linkedHashMap.put("/admin/owner-list.jsp", "roles[owner-list.jsp]");
        linkedHashMap.put("/admin/housing-estate-list.jsp", "roles[housing-estate-list.jsp]");
        linkedHashMap.put("/admin/system-dict-list.jsp", "roles[system-dict-list.jsp]");
        linkedHashMap.put("/admin/reclamation-order-list.jsp", "roles[reclamation-order-list.jsp]");
        linkedHashMap.put("/admin/system-log.jsp", "roles[system-log.jsp]");
        linkedHashMap.put("/admin/system-shielding.jsp", "roles[system-shielding.jsp]");
        linkedHashMap.put("/admin/system-base.jsp", "roles[system-base.jsp]");
        linkedHashMap.put("/**", "authc");
        return linkedHashMap;
    }
}
